<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo Yii::$app->name;?> 后台管理</title>
<?php $this->HeaderView(array_merge($headerPlugins, ['template']));?>
</head>
<body class="view_form" id="view_form_Auction">
<table class="view-form-input" border="0" cellspacing="0" cellpadding="0" width="100%">
    <thead>
    <?php
	$tableName = $models['models']['tablename'];
	$class = 'submodule_'.$tableName;
	$sFile = "../runtime/submodule_save/$class.php";
	require($sFile);
	
	$function = new $class($models, $model, $modelid);
    foreach($fields as $k=>$v){
        if (!$v['allowinput'] || !$v['enabled']) continue;
    ?>
                            <tr>
            <th valign="top" class="td-title"><label for="catid"><?php echo $v['name'];?>：</label></th>
            <td class="td-input">
            <?php
			$defaultvalue = isset($v['setting']['defaultvalue']) ? $v['setting']['defaultvalue'] : NULL;
			$value = isset($model[$v['field']]) ? $model[$v['field']] : $defaultvalue;
			if (in_array($v['field'], ['addtime', 'updatetime'])){
				$value = date('Y-m-d H:i:s', $value);
			}
			if (method_exists($function, $v['field'].'_view')){
				$viewfunction = $v['field'].'_view';
				$value = $function->$viewfunction($v['fieldid'], $v['field']);
			}
			echo $value;
?>
            </td>
        </tr>
        
    <?php
    }
    ?>
          <tr>
            <th></th>
            <td><br>
            <button class="ui-btn ui-btn-primary" type="button" onclick="window.history.go(-1);">返回</button>
                </td>
        </tr>
        
            </tbody>
        
</table>


<?php $this->FooterView();?>
</body>
</html>


